import pynumpak


def test():
    A1 = pynumpak.linalg.vec_from_array([1, 2, 3, 4, 5, 6])
    B1 = pynumpak.linalg.vec_from_array([3, 6, 5, 6, 7, 8])
    p2 = pynumpak.linalg.poly_fit(A1, B1, sigma=lambda x: x ** 2)
    print(p2)
    # [-4.70956381 10.82529836 -3.45401869  0.34089048]

    # A2 = pynumpak.linalg.mat_from_array([[0, 1], [-1, 0]])
    # print(pynumpak.linalg.eigen(A2))
    #
    # A3 = pynumpak.linalg.mat_from_array([[2, 0.5, 0.5], [0.5, 2, 0.8], [0.5, 0.8, 2]])
    # B3 = pynumpak.linalg.vec_from_array([3, 3, 3])
    #
    # print(pynumpak.linalg.cg(A3, B3))
    # print(pynumpak.linalg.solve(A3, B3))


if __name__ == "__main__":
    test()
